package com.piece.admin.api.dto;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.piece.core.framework.annotation.office.ExcelCellConvert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@ApiModel(value = "系统用户类")
@ContentRowHeight(60)
@ExcelIgnoreUnannotated
public class SysUserDTO implements Serializable {

    @ApiModelProperty(value = "主键")
    private Long userId;

    @ExcelProperty(index = 0, value = "登陆账号")
    @ApiModelProperty(value = "登陆名")
    private String loginName;

    @ExcelProperty(index = 1, value = "用户昵称")
    @ApiModelProperty(value = "用户昵称")
    private String userName;

    @ExcelProperty(index = 2, value = "用户类型")
    @ExcelCellConvert(convertFormat = "00=后台用户,01=前台用户", combo = {"后台用户", "前台用户"})
    @ApiModelProperty(value = "用户类型", notes = "00后台用户 01前台用户")
    private String userType;

    @ExcelProperty(index = 3, value = "所属部门")
    @ApiModelProperty(value = "所属部门")
    private String deptName;

    @ExcelProperty(index = 4, value = "性别")
    @ExcelCellConvert(convertFormat = "0=男,1=女,2=未知", combo = {"男", "女", "未知"})
    @ApiModelProperty(value = "性别", notes = "0男 1女 2未知")
    private String sex;

    @ExcelProperty(index = 5, value = "邮箱")
    @ApiModelProperty(value = "邮箱")
    private String email;

    @ExcelProperty(index = 6, value = "手机")
    @ApiModelProperty(value = "手机")
    private String mobile;

    @ColumnWidth(value = 15)
    @ExcelProperty(index = 7, value = "头像")
    @ExcelCellConvert(imageRender = true)
    @ApiModelProperty(value = "头像路径")
    private String avatar;

    @ExcelProperty(index = 8, value = "帐号状态")
    @ExcelCellConvert(convertFormat = "0=正常,1=删除,2=停用", combo = {"正常", "删除", "停用"})
    @ApiModelProperty(value = "帐号状态", notes = "0=正常,1=删除,2=停用")
    private String status;
}
